package test.thread;

public class Producer implements Runnable {

	private ProductStack stack;
	
	public Producer(ProductStack stack){
		this.stack = stack;
	}
	
	
	@Override
	public void run() {
		String goods;
		for(int i=0; i<200;i++) {
			goods = "goods" + (stack.getPoint() + 1);
			stack.push(goods);
			System.out.println("Producer "+(i+1)+ " produce:"+goods);
			Thread.yield();
		}
	}
}
